package com.neuedu.web;

import com.neuedu.service.UserinfoService;
import com.neuedu.service.UserinfoServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "UserEmailCheckServlet",urlPatterns = "/user/emailCheck")
public class UserEmailCheckServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取请求参数
        String email = request.getParameter("email");
        //调service层
        UserinfoService us = new UserinfoServiceImpl();
        int num = us.UserEmailCheck(email);
        response.getWriter().println(num);
    }
}
